# This dockerfile uses php7 image
# VERSION 1.0
# Author: zhaojianhui
# Command format: Instruction [arguments / command] ..

FROM php:7.4-fpm

#ARG APT_MIRROR=httpredir.debian.org

# init php extension
RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libxml2-dev \
        libzip-dev \
        wget \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd

# Add phpredis
ENV PHP_REDIS 5.2.1-liveness
RUN wget https://codeload.github.com/phpredis/phpredis/tar.gz/$PHP_REDIS -O /tmp/phpredis-$PHP_REDIS.tar.gz \
    && cd /tmp \
    && tar -zxvf phpredis-$PHP_REDIS.tar.gz \
    && cd /tmp/phpredis-$PHP_REDIS \
    && phpize \
    && ./configure \
    && make && make install \
    && docker-php-ext-enable redis \
    && rm -rf /tmp/phpredis-$PHP_REDIS /tmp/phpredis-$PHP_REDIS.tar.gz

RUN docker-php-ext-install -j$(nproc) bcmath shmop sysvsem pcntl sockets xmlrpc zip soap gettext opcache \
    && docker-php-ext-install mysqli pdo_mysql

# 配置文件更改
COPY ./conf /usr/local/etc/php